#!/bin/bash
export ii=$II
export i=$I
out=/dev/null
my_vers=X.01.08.090
my_vers=X.01.06.260
compare_vers=X.01.10.180
#format mmddyy
adate=12/31/02
adate=01/31/02
adate=2005/01/25
adate=2005/03/15
adate=2005/03/07
adate=2005/03/16
set -x
tmpa=$ii/tmpamksvn
#Note you cannot execute functions inside -exec so need to send to file.
#find seeker ods -type f | \
#seeker/src/conf/properties/SeekerPreferences.xml \
#seeker/src/ksh/verity \
#seeker/src/perl/verity \
#seeker/src/java/com/hp/seeker/util/verity/verityconnector -type f |
cd $ii
find csr/trunk/ods csr/trunk/cs csr/trunk/sdl misc/trunk/std_loader \
misc/trunk/testsearchn misc/trunk/perftestn	-type f | \
  grep -v -e '\.class$' -e '\.jar$' -e '\.wmf$' -e '/Entries$' \
  -e '/target/' -e '/junitdoclet/' \
  -e 'Root$' -e 'Repository$' -e 'Entries$' -e 'Tag$' -e '\.#' -e '/CVS/' \
  -e '\.dfPackage$' -e '\.dfUseCase$' -e '\.dfActivity$' -e '\.dfSequence$' \
  -e '\.svn' -e '\.dfUseCase$' -e '\.dfActivity$' -e '\.dfSequence$' \
  > $tmpa
  #more $tmpa
rm -f new_src_map
rm -f new_src_not
echo "Using date $adate"
#set -x
cat $tmpa | \
while read afile ; do
set -x
  fn=$(basename $afile)
  #echo fn=$fn
  dirn=$(dirname $afile)
  cd $ii/$dirn
  if (( $? != 0 )) ; then
    echo "Error could not cd to $ii/$dirn" >&2
    continue
  fi
  if [[ ! -d .svn ]] ; then
    continue
  fi
  echo Processing $fn
  svn log --revision {2006-12-01}:{2007-12-01} $fn 2>&1 | fold > $ii/$fn.log
  if (( $? != 0 )) ; then
    echo $afile
  fi
  grep -q $USER $ii/$fn.log
  if (( $? == 0 )) ; then
    echo file=$fn >> $ii/new_src_map
    cat $ii/$fn.log >> $ii/new_src_map
	else
    echo no $USER file=$fn >> $ii/new_src_not
    cat $ii/$fn.log >> $ii/new_src_not
  fi
  rm $ii/$fn.log
done
